(function(window) {
    class localData {
        saveData = function(key, item) {
            if (item) {
                localStorage.setItem(key, JSON.stringify(item));
                return 1;
            }
            return 0;
        }
        getData = function(key) {
            let temp = localStorage.getItem(key) || null;
            if (temp) {
                return JSON.parse(temp);
            }
            return temp;
        }
    }
    window.localData = localData;
}(window))